package com.softtown.modules.workflow.service;


import com.softtown.common.service.BaseService;
import com.softtown.modules.workflow.dto.SwfProcPhaseDTO;
import com.softtown.modules.workflow.entity.SwfProcPhaseEntity;

import java.util.List;


/**
 * @author: Dingyayong
 * @Date: 2019/8/22 13:56
 * @Description:流程实例审批段
 */
public interface SwfProcPhaseService extends BaseService<SwfProcPhaseEntity> {

    /**
     * 找出差旅报销单审批段第一个审批段
     * @param compId 公司id
     * @param procInstId 流程实例id
     * @return SwfProcPhaseEntity
     * @author Dingyayong
     * @date 2019/11/12 17:24
     */
    SwfProcPhaseEntity getActHeadFristSort(Long compId, Long procInstId);

    /**
     * 找出差旅报销单审批段最后一个审批段
     * @param compId 公司id
     * @param procInstId 流程实例id
     * @return SwfProcPhaseEntity
     * @author Dingyayong
     * @date 2019/11/12 17:24
     */
    SwfProcPhaseEntity getActHeadLast(Long compId, Long procInstId);

    /**
     * 找出差旅报销单审批段当前审批段定义
     * @param compId 公司id
     * @param phaseId 审批段id
     * @return SwfProcPhaseEntity
     * @author Dingyayong
     * @date 2019/11/12 17:24
     */
    SwfProcPhaseEntity getActHeadByNow(Long compId, Long phaseId, Long procInstId);

    /**
     * 找出差旅报销单审批段当前审批段定义的下个审批段定义
     * @param compId 公司id
     * @param procInstId 实例id
     * @param sortNum 序号
     * @return SwfProcPhaseEntity
     * @author Dingyayong
     * @date 2019/11/12 17:24
     */
    SwfProcPhaseEntity getActHeadNextBySort(Long compId, Long procInstId,Integer sortNum);

    /**
     * 找出当前单据已有的流程审批段（按照sort_num排序）
     * @param swfProcPhaseDTO 流程实例审批段接受实体类
     * @return SwfProcPhaseEntity
     * @author Dingyayong
     * @date 2019/11/12 17:24
     */
    List<SwfProcPhaseEntity> getSwfProcPhaseListBySort(SwfProcPhaseDTO swfProcPhaseDTO);

    /**
     * 找出当前单据已有的流程审批段（按照sort_num排序）
     * @param compId 公司id
     * @param procInstId 实例id
     * @return SwfProcPhaseEntity
     * @author Dingyayong
     * @date 2019/11/12 17:24
     */
    List<SwfProcPhaseEntity> getSwfProcPhaseBySortList(Long compId, Long procInstId);
    /**
     * 找出流程审批段按照id
     * @param phaseId id
     * @return SwfProcPhaseEntity
     * @author Dingyayong
     * @date 2019/11/12 17:24
     */
    List<SwfProcPhaseEntity> getSwfProcPhaseByPhaseIdList( Long phaseId);
}
